import { request } from '../http'

export function listRole(params?: any) {
    return request.Get('/system/role/list', { params })
}
export function changeRoleStatus(roleId: number, status: string) {
    const data = {
        roleId,
        status
    }
    return request.Put('/system/role/changeStatus', data)
}
// 获取角色详情
export function getRole(roleId: number) {
    return request.Get(`/system/role/${roleId}`)
}
// 新增
export function addRole(data: any) {
    return request.Post(`/system/role`, data)
}
// 修改
export function updateRole(data: any) {
    return request.Put(`/system/role`, data)
}
// 删除
export function delRole(roleId: number) {
    return request.Delete(`/system/role/${roleId}`,)
}
// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId: number) {
    return request.Get(`/system/menu/roleMenuTreeselect/${roleId}`)
}